<?php


namespace app\admin\controller;
use app\admin\logic\AdminLogic;

/**
 * 会员控制器
 */
class Admin extends AdminBase
{
//
//    /**
//     * 会员授权
//     */
//    public function adminAuth()
//    {
//
//        IS_POST && $this->jump($this->logicAdmin->addToGroup($this->param));
//
//        // 所有的权限组
//        $group_list = $this->logicAuthGroup->getAuthGroupList(['admin_id' => ADMIN_ID]);
//
//        // 会员当前权限组
//        $admin_group_list = $this->logicAuthGroupAccess->getAdminGroupInfo($this->param['id']);
//
//
//        // 选择权限组
//        $list = $this->logicAuthGroup->selectAuthGroupList($group_list, $admin_group_list);
//
//        $this->assign('list', $list);
//
//        $this->assign('id', $this->param['id']);
//
//        return $this->fetch('admin_auth');
//    }
    
    /**
     * 会员列表
     */
    public function adminList()
    {
        $where = AdminLogic::getWhere($this->params);

        return $this->returnData('', AdminLogic::getAdminList($where));


    }
    
//    /**
//     * 会员导出
//     */
//    public function exportAdminList()
//    {
//
//        $where = $this->logicAdmin->getWhere($this->param);
//
//        $this->logicAdmin->exportAdminList($where);
//    }
//
    /**
     * 会员添加
     */
    public function adminAdd()
    {


        $this->returnData('',AdminLogic::adminAdd( $this->params));
    }

    /**
     * 会员编辑
     */
    public function adminEdit()
    {

        IS_POST && $this->returnData('',AdminLogic::adminEdit($this->params));

        $this->returnData('',AdminLogic::getAdminInfo( $this->params['id']));


    }

    /**
     * 会员删除
     */
    public function adminDel($id = 0)
    {
        $this->returnData('',AdminLogic::adminDel( $this->params));
    }
//
//    /**
//     * 修改密码
//     */
//    public function editPassword()
//    {
//
//        IS_POST && $this->jump($this->logicAdmin->editPassword($this->param));
//
//        $info = $this->logicAdmin->getAdminInfo(['id' => ADMIN_ID]);
//
//        $this->assign('info', $info);
//
//        return $this->fetch('edit_password');
//    }
}
